|
In object-oriented programming, method cascading is syntax which allows multiple methods to be called on the same object. This is particularly applied in fluent interfaces. For example in Dart, the cascade: is equivalent to the individual calls: Method cascading is much less common than method chaining – it is found only in a handful of object-oriented languages, while chaining is very common. A form of cascading can be implemented using chaining, but this restricts the interface; see comparison with method chaining, below. ==Application== Cascading is syntactic sugar that eliminates the need to list the object repeatedly. This is particularly useful if the object is the value of a lengthy expression, as it eliminates the need to either list the expression repeatedly or use a temporary variable. This is particularly used in fluent interfaces, which feature many method calls on a single object. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Method cascading」の詳細全文を読む スポンサード リンク
|